﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data.Linq.Mapping;
using System.Device.Location;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace DnD.Model
{
    [Table]
    class DnDMapElement : INotifyPropertyChanged
    {

        private double _positionLatitude;
        private double _positionLongitude;
        private string _pictureName;
        private int _id;


        [Column(IsDbGenerated = true, IsPrimaryKey = true)]
        public int Id
        {
            get { return _id; }
            set
            {
                _id = value;
                OnPropertyChanged();
            }
        }

        [Column]
        public double PositionLatitude
        {
            get { return _positionLatitude; }
            set
            {
                _positionLatitude = value;
                OnPropertyChanged();
            }
        }

        [Column]
        public double PositionLongitude
        {
            get { return _positionLongitude; }
            set
            {
                _positionLongitude = value;
                OnPropertyChanged();
            }
        }


        [Column]
        public string PictureName
        {
            get { return _pictureName; }
            set
            {
                _pictureName = value;
                OnPropertyChanged();
            }
        }


        public event PropertyChangedEventHandler PropertyChanged;
       

        private void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null)
                handler(this, new PropertyChangedEventArgs(propertyName));
        }

    }
}
